home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / DirectPlay / SimpleClientServer / Common / simpleclientserver.h
Encoding:
C/C++ Source or Header  |  2001-10-31  |  2.2 KB  |  70 lines

  1. //----------------------------------------------------------------------------
  2. // File: SimpleClientServer.h
  3. //
  4. // Desc: see SimpleClient.cpp
  5. //
  6. // Copyright (c) 1999-2001 Microsoft Corp. All rights reserved.
  7. //-----------------------------------------------------------------------------
  8.  
  9.  
  10.  
  11.  
  12. //-----------------------------------------------------------------------------
  13. // Defines, and constants
  14. //-----------------------------------------------------------------------------
  15. #define DPLAY_SAMPLE_KEY        TEXT("Software\\Microsoft\\DirectX DirectPlay Samples")
  16. #define MAX_PLAYER_NAME         14
  17. #define WM_APP_UPDATE_STATS    (WM_APP + 0)
  18. #define WM_APP_DISPLAY_WAVE    (WM_APP + 1)
  19.  
  20. // This GUID allows DirectPlay to find other instances of the same game on
  21. // the network.  So it must be unique for every game, and the same for 
  22. // every instance of that game.  // {EDE9493E-6AC8-4f15-8D01-8B163200B966}
  23. GUID g_guidApp = { 0xede9493e, 0x6ac8, 0x4f15, { 0x8d, 0x1, 0x8b, 0x16, 0x32, 0x0, 0xb9, 0x66 } };
  24.  
  25.  
  26.  
  27.  
  28. //-----------------------------------------------------------------------------
  29. // App specific DirectPlay messages and structures 
  30. //-----------------------------------------------------------------------------
  31. #define GAME_MSGID_WAVE             1
  32. #define GAME_MSGID_CREATE_PLAYER    2
  33. #define GAME_MSGID_DESTROY_PLAYER   3
  34. #define GAME_MSGID_SET_ID           4
  35.  
  36. // Change compiler pack alignment to be BYTE aligned, and pop the current value
  37. #pragma pack( push, 1 )
  38.  
  39. struct GAMEMSG_GENERIC
  40. {
  41.     DWORD dwType;
  42. };
  43.  
  44. struct GAMEMSG_WAVE : public GAMEMSG_GENERIC
  45. {
  46.     DWORD dpnidPlayer;                 // dpnid of the player created
  47. };
  48.  
  49. struct GAMEMSG_SET_ID : public GAMEMSG_GENERIC
  50. {
  51.     DWORD dpnidPlayer;                 // dpnid of the player 
  52. };
  53.  
  54. struct GAMEMSG_CREATE_PLAYER : public GAMEMSG_GENERIC
  55. {
  56.     DWORD dpnidPlayer;                          // dpnid of the player created
  57.     TCHAR strPlayerName[MAX_PLAYER_NAME];   // name of the player created
  58. };
  59.  
  60. struct GAMEMSG_DESTROY_PLAYER : public GAMEMSG_GENERIC
  61. {
  62.     DWORD dpnidPlayer;                 // dpnid of the player destroyed
  63. };
  64.  
  65. // Pop the old pack alignment
  66. #pragma pack( pop )
  67.  
  68.  
  69.  
  70.